package com.itheima;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/*
@SpringBootApplication
@EnableEurekaClient //声明是一个eureka客户端 ---》@EnableDiscoveryClient
@EnableDiscoveryClient：支持的注册中心有：eureka/zk/nacos/apollo
@EnableEurekaClient: 仅支持eureka注册中心
@EnableCircuitBreaker //开启熔断器的支持
*/

@SpringCloudApplication //一个顶三
@EnableHystrixDashboard //开启熔断器监控
public class ConsumerServiceApplication {
	public static void main(String[] args) {
		SpringApplication.run(ConsumerServiceApplication.class, args);
	}
	@Bean
	@LoadBalanced //使用ribbon进行负载调用
	public RestTemplate restTemplate(){
		return new RestTemplate();
	}
}
